{% extends 'layout.html.twig' %}
{% do script(['libs/jquery-validation.js','app/js/init-password/index.js']) %}
{% set bodyClass = 'login' %}

{% block title %}{{ 'user.login.content_title'|trans }} - {{ parent() }}{% endblock %}

{% block content %}

  <div class="es-section login-section login-init-section">
    <div class="login-main cd-pt24">
      <h2 class="login-init-section__title">{{ 'user.init.password_tips'|trans }}</h2>
      <form class="form-vertical" id="init-password-form" action="{{ path('password_init') }}" method="post">
        <div class="form-group mbl">
          <label class="control-label" for="newPassword">{{ 'user.register.password_label'|trans }}</label>
          <div class="controls">
            <input class="form-control input-lg" id="newPassword" type="password" name="newPassword" value="" required="required"
                   placeholder="{{ 'user.init.password_placeholder'|trans }}"/>
            <div class="help-block"></div>
          </div>
        </div>
        <div class="form-group mbl">
          <label class="control-label" for="confirmPassword">{{ 'user.oauth.register.confirm_password_label'|trans }}</label>
          <div class="controls">
            <input class="form-control input-lg" id="confirmPassword" type="password" name="confirmPassword" required="required" placeholder="{{ 'user.init.password_placeholder_again'|trans }}"/>
          </div>
        </div>

        <div class="form-group mbl cd-mt24">
          <button type="submit" data-loading-text="{{ 'user.init.password.submit.password.loading'|trans }}" class="btn btn-primary btn-lg btn-block js-btn-login">{{ 'user.init.password.confirm.password'|trans }}</button>
        </div>

        <input type="hidden" id="password_level" value="{{ setting('auth.password_level')|default('low') }}">
        <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
        <input type="hidden" name="goto" value="{{app.request.get('goto')}}">
      </form>
    </div>
  </div>

{% endblock %}
